home *** CD-ROM | disk | FTP | other *** search
/ Space Simulation Series 1: Lift Off / Liftoff Space Simulation Series Part 1 (ETI Entertainment)(2002).iso / Exploration / globals / javascript.js < prev    next >
Text File  |  2002-06-28  |  2KB  |  58 lines

  1. //how is this code used?
  2. function newWindow(nwurl,nwspecs){
  3.   window.open(nwurl,'contentWindow', nwspecs);
  4.   }
  5. // specs gets set to a string with this exact order: 
  6. // 'toolbar=no,location=no,scrollbars=auto,width=360,height=370' (horizontal window)
  7. // 'toolbar=no,location=no,scrollbars=auto,width=280,height=460' (vertical window)
  8.     
  9.     
  10. //open popup windows from all pages
  11. function imageWindow(nwurl,width,height) {
  12.   var name = nwurl.substring(6, nwurl.indexOf("."));
  13.   width = width + 25;
  14.   height = height + 100;
  15.  
  16.   popupWindow = window.open(nwurl,'window_'+name, 'toolbar=no,resizable=yes,scrollbars=auto,modal=yes,width='+width+',height='+height+',screenX=40,screenY=60,left=40,top=60');
  17.   popupWindow.focus();
  18.   
  19. }
  20.  
  21. //open activity windows (from space imaging)
  22. function openActivityWindow(nwurl,width,height){
  23.  
  24.   var browserWidth = screen.availWidth;
  25.   var windowHPos = ((browserWidth/2) - (width/2));
  26.   var browserHeight = screen.availHeight;
  27.   var windowVPos =((browserHeight/2) - (height/2));
  28.   
  29.   activityWindow = window.open(nwurl, 'activityWindow', 'toolbar=no,resizable=yes,width='+width+',height='+height+',screenX='+windowHPos+',screenY='+windowVPos+',left='+windowHPos+',top='+windowVPos);
  30.   activityWindow.focus();
  31. }
  32.  
  33. //open table window (from space race)
  34. function tableWindow(nwurl,width,height) {
  35.   width = width + 20;
  36.   height = height + 20;
  37.   
  38.   tableWindow = window.open(nwurl,'contentWindow', 'toolbar=no,location=no,scrollbars=yes,width='+width+',height='+height+',screenX=0,screenY=0,left=0,top=0');
  39.   tableWindow.focus();
  40. }
  41.  
  42. //open glossary window from the_story pages and benefits pages
  43. function glossaryItem(word) {
  44. //alert('I am going to the glossary to find the word: ' + word);
  45.   
  46.   glossaryWindow = window.open('../../glossary/index.html#' + word ,'glossary', 'toolbar=no,location=no,scrollbars=yes,width=350,height=200');
  47.   glossaryWindow.focus();
  48. }
  49.  
  50. //open glossary window from canadas_role and careers pages
  51. function glossaryItemCanada(word) {
  52. //alert('I am going to the glossary to find the word: ' + word);
  53.  
  54.   window.open('../glossary/index.html#' + word ,'glossary', 'toolbar=no,location=no,scrollbars=yes,width=350,height=200');
  55.   glossaryWindow.focus();
  56. }
  57.  
  58.